<!DOCTYPE html>
<html ng-app="peiwan_admin">
<head>
<meta charset="UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">  
<title>网吧列表</title>
<script type="text/javascript" src="js/settings.min.js"></script>
<script type="text/javascript"
	src="http://cdn.bootcss.com/basket.js/0.5.2/basket.full.min.js"></script>
<link rel="stylesheet"
	href="http://cdn.bootcss.com/pure/0.6.0/pure-min.css">
<link rel="stylesheet" href="css/adapt.min.css">
<link rel="stylesheet"
	href="http://cdn.bootcss.com/alertify.js/0.3.11/alertify.core.min.css">
<link rel="stylesheet"
	href="http://cdn.bootcss.com/alertify.js/0.3.11/alertify.default.css">
</head>
<body ng-controller="NetbarListCtrl">
	<dialog id="update_netbar_dialog">
	<p>
		{{label}}<input id="netbar_update_text" placeholder="{{hint}}">
	</p>
	<button ng-click="updateOk()">确定</button>
	<button ng-click="updateCancel()">关闭</button>
	</dialog>

	<dialog id="update_netbar_dialog2">
	<p>
		<img class="logo1" alt="" ng-src="{{imgUrl}}"> 更改<input
			id="netbar_update_file" type="file">
	</p>
	<button ng-click="updateOk2()">确定</button>
	<button ng-click="updateCancel2()">关闭</button>
	</dialog>

	<dialog id="insert_netbar_dialog">
	<p>
		名称<input id="netbar_insert_name" placeholder="名称">
	</p>
	<p>
		门面照<input id="file" type="file"> <img alt="" src=""
			class=".logo1">
	</p>
	<p>
		排序<input id="netbar_insert_sort" placeholder="排序">
	</p>
	<p>
		地址<input id="netbar_insert_address" placeholder="地址">
	</p>
	<p>
		电话<input id="netbar_insert_phone" placeholder="电话">
	</p>
	<button ng-click="ok()">确定</button>
	<button ng-click="closeDialog()">关闭</button>
	</dialog>

	<dialog id="photo_wall_dialog">
	<div>
		<input id="photo_file" type="file">
		<button ng-click="addPhoto(netbar)">添加</button>
		<button ng-click="closePhotoWallDialog()">取消</button>
	</div>
	<div ng-repeat="netbarPhoto in netbar.netbarPhotos"
		class="pure-u-1-5 padding3">
		<p>
			<img alt="" ng-src="{{netbarPhoto.url}}" class="width-100">
		</p>
		<p>
			<button ng-click="changeNetbarPhoto(netbarPhoto.id)">更换</button>
			<button ng-click="deleteNetbarPhoto(netbarPhoto.id)">删除</button>
		</p>
	</div>
	</dialog>
	<div class="pure-u-1 padding3">
		<input id="netbar_name_text" type="search" placeholder="网吧名字"><input
			ng-click="startSearch()" type="button" value="搜索">
	</div>
	<div class="pure-u-1 padding3">
		<input ng-click="showInsertNetbarForm()" type="button" value="添加网吧">
	</div>
	<div class="pure-u-1 padding3">
		<table class="horizontal-center pure-table pure-table-bordered">
			<thead>
				<tr>
					<th>#</th>
					<th>店面照</th>
					<th>名字</th>
					<th>排序</th>
					<th>地址</th>
					<th>电话</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				<tr ng-repeat="netbar in netbars">
					<td>{{netbar.id}}</td>
					<td><img
						ng-click="updateNetbar(netbar.id,'photoUrl',netbar.photoUrl)"
						class="logo1" alt="" ng-src="{{netbar.photoUrl}}"></td>
					<td ng-click="updateNetbar(netbar.id,'name',netbar.name)">{{netbar.name}}</td>
					<td ng-click="updateNetbar(netbar.id,'sort',netbar.sort)">{{netbar.sort}}</td>
					<td ng-click="updateNetbar(netbar.id,'address',netbar.address)">{{netbar.address}}</td>
					<td ng-click="updateNetbar(netbar.id,'phone',netbar.phone)">{{netbar.phone}}</td>
					<td>
						<button ng-click="deleteNetbar(netbar.id)"
							class="pure-button horizontal-center red">删除</button>
						<button ng-click="lookPhotos(netbar)"
							class="pure-button horizontal-center green">查看相册</button>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</body>
<script type="text/javascript" src="js/netbar_list.min.js"></script>
</html>